/**
 * @Description : watch.js
 * @Author : Tomi
 * @Email : lintaoming@qq.com
 * @Create : 2017/4/15
 */
'use strict';

const gulp = require('gulp');
const config = require('../config');
const browserSync = require('./broswersync');
const watch = require('gulp-watch');

gulp.task('watch', () => {

    // gulp.watch(config.scss.all, ['scss']);
    watch(config.scss.all, function(){
        gulp.start('scss');
    });

    // gulp.watch(config.images.src+'/**/*', ['images']);
    watch(config.images.src+'/**/*', function(){
        gulp.start('images');
    });

    watch([config.images.sprite+'/**/*.png','!'+config.images.src+'/_sprite.png'], function(){
        gulp.start('sprite');
    });

    // gulp.watch(config.html.all, ['ejs']);
    watch(config.html.all, function(){
        gulp.start('ejs');
    });

    gulp.watch(config.script.src, ['script']);

});